const axios = require('axios');

// 测试通过openid从微信服务器获取用户信息
async function testWechatUserInfo() {
  try {
    // 使用一个测试用的openid
    const testOpenid = 'test_openid_12345';
    
    // 调用接口从微信服务器获取用户信息
    const response = await axios.get(`http://localhost:3000/api/users/wechat-info/${testOpenid}`);
    
    console.log('WeChat user info:', response.data);
  } catch (error) {
    console.error('Test failed:', error.response ? error.response.data : error.message);
  }
}

testWechatUserInfo();
